#ifndef __CONTROL_H__
#define __CONTROL_H__

#include "ctrl_pid.h"

#define LOST_CNT_MAX    (4000)

typedef enum
{
      DemoCtrl_RC_On = 0,
    DemoCtrl_RC_Off,
}DemoCtrl_t;

typedef enum
{
    Demo_St = 0,    // start point
    Demo_StToSp,    // start point to stop point
    Demo_StLdLu,    // start point to leftdown to left up
    
    Demo_Num,
}Demo_t;

typedef enum
{
    Auto_Off = 0,
    Unlock_RightDown,
    Unlock_ThrMid,
    Auto_On,
    Lock,
    
}Msg_CtrlToFMU_Type_t;

//typedef enum
//{
//    Demo_St_Act_Climb = 0,//����
//    Demo_St_Act_Stable,//����
//    Demo_St_Act_Hover,//��ͣ
//    Demo_St_Act_Land,//����
//    Demo_St_Act_Lock,//����
//    
//    Demo_St_Act_Num,    
//}Demo_St_Act_t;

typedef enum
{
    Demo_StToSp_Act_Climb = 0,
    Demo_StToSp_Act_Stable,
    Demo_StToSp_Act_StHover,
    Demo_StToSp_Act_ToSp,
    Demo_StToSp_Act_SpHover,
    Demo_StToSp_Act_Land,
    Demo_StToSp_Act_Lock,
    
    Demo_StToSp_Act_Num,
}Demo_StToSp_Act_t;

typedef enum
{
    Demo_StLdLu_Act_Climb = 0,
    Demo_StLdLu_Act_Stable,
    Demo_StLdLu_Act_Hover,
    Demo_StLdLu_Act_ToLd,
    Demo_StLdLu_Act_LdHover,
    Demo_StLdLu_Act_ToLu,
    Demo_StLdLu_Act_Land,
    Demo_StLdLu_Act_Lock,
    
    Demo_StLdLu_Act_Num,
}Demo_StLdLu_Act_t;



void SysCtrl_Update_PID_Set(void);
void SysCtrl_Init_RC_Offset(void);
void SysCtrl_Init_Demo(void);
void SysCtrl_Update_PID(void);
//void SysCtrl_Update_PID_Sample(void);
void SysCtrl_Update_PID_Error(void);
void SysCtrl_Update_PID_Calculate(void);
void SysCtrl_Update_PID_Change(void);
void SysCtrl_Update_Act(void);
void SysCtrl_Update_Lost_Info(void);
void SysCtrl_Update_Msg_Ctrl_To_FMU_Type(Msg_CtrlToFMU_Type_t MsgType);
void SysCtrl_Update_Msg_Ctrl_To_FMU(void);
void SysCtrl_Unlock_FMU(uint32 UnlockLasted_ms);

YesNo_t Is_On_Node(YesNo_t F, YesNo_t B, YesNo_t L, YesNo_t R);

#endif  // __CONTROL_H__

